
import request from '@/plugin/axios'

// 获取列表
export function getdeptlist (params) {
  return request({
    url: '/upms/dept/list',
    method: 'get',
    params: request.adornParams(params)
  })
}

// 获取信息
export function getdeptinfo (id) {
  return request({
    url: '/upms/dept/info/' + id,
    method: 'get',
    params: request.adornParams({})
  })
}
// 获取简单部门树
export function getdeptsimpletree(params) {
    return request({
        url: '/upms/dept/simple/tree',
        method: 'get',
        params: request.adornParams(params)
    })
}
// 获取列表树
export function getdepttree (params) {
    return request({
      url: '/upms/dept/tree',
      method: 'get',
      params: request.adornParams(params)
    })
  }
// 添加
export function adddept (data) {
  return request({
    url: '/upms/dept/save',
    method: 'post',
    data
  })
}

// 修改
export function updatedept (data) {
  return request({
    url: '/upms/dept/update',
    method: 'put',
    data
  })
}

// 批量删除
export function delBatchdept (params) {
  return request({
    url: '/upms/dept/delete',
    method: 'post',
    data: request.adornData(params, false)
  })
}

// 删除
export function deldept(id) {
  return request({
    url: '/upms/dept/delete/' + id,
    method: 'delete',
  })
}

// 数据导出
export function deptExport (params) {
    return request({
      url: '/report/dept/export',
      method: 'get',
      params: request.adornParams(params)
    })
  }